//全局函数，AES解密
globalThis.AESJieMi = function (ciphertext) {
	const keyBytes = CryptoJS.enc.Utf8.parse("ygcnbckhcuvygdyb");
	const ivBytes = CryptoJS.enc.Utf8.parse("4023892775143708");
	try {
		// 如果密文是 HEX 格式，需要先解析
		const ciphertextBytes = CryptoJS.enc.Hex.parse(ciphertext);
		const decrypted = CryptoJS.AES.decrypt(
		// 将 HEX 解析后的密文转换为 CryptoJS 支持的格式
		{ ciphertext: ciphertextBytes },
		keyBytes,
		{
			iv: ivBytes,
			mode: CryptoJS.mode.CBC,
			padding: CryptoJS.pad.Pkcs7
		}
		);
		// 返回 UTF-8 字符串
		return decrypted.toString(CryptoJS.enc.Utf8) || '';
	} catch (error) {
		console.error('AES 解密失败:', error.message);
		return '';
	}
};
//drpy2主体rule对象
var rule = {
	title: '即看影视app',
	host: 'https://appsky2025999.ideasz.net',
	hostJs: '',
	headers: {'User-Agent': MOBILE_UA},
	编码: 'utf-8',
	timeout: 5000,
	homeUrl: '/sk-api/vod/list?page=1&limit=100&type=aqy',
//	url: '/sk-api/vod/list?fyfilter',
//	filter_url: 'wd=&order={{fl.by}}&type_id=fyclass&class={{fl.class}}&area={{fl.area}}&year={{fl.year}}&state={{fl.state}}&page=fypage',
//	filter_url: '/sk-api/vod/list?typeId=fyclass&page=fypage&limit=18&type=updateTime&area={{fl.area}}&lang=&year={{fl.year}}&mtype=&extendtype=',
	url: '/sk-api/vod/list?typeId=fyclass&page=fypage&limit=18&type=updateTime&area=&lang=&year=&mtype=&extendtype=',
	searchUrl: '/sk-api/search/pages?keyword=**&page=fypage&limit=10&typeId=-1',
	detailUrl: '/sk-api/vod/one?vodId=fyid',

	limit: 9,
	double: false,
	class_name: '电影&电视剧&动漫&综艺&短剧&日韩&欧美',
	class_url: '1&2&4&3&53&15&16',
	filter_def: {},

	推荐:'*',
	一级: $js.toString(() => {
		let d = [];
		let khtml = fetch(input).replaceAll('FROMSKZZJM','');
		let list = JSON.parse(AESJieMi(khtml)).data;
		list.forEach(it => {
			d.push({
				url:it.vod_id,
				title: it.vod_name,
				desc: it.vod_remarks,
				year: it.vod_douban_score,
				img:it.vod_pic
			})
		});
		setResult(d);
	}),
	搜索: '*',
	二级: $js.toString(() => {
		let khtml = fetch(input).replaceAll('FROMSKZZJM','');
		let kvod = JSON.parse(AESJieMi(khtml)).data;
		VOD = {
			vod_id: kvod.vod_id,
			vod_name: kvod.vod_name,
			vod_pic: kvod.vod_pic,
			type_name: kvod.vod_class,
			vod_remarks: kvod.vod_remarks,
			vod_year: kvod.vod_year,
			vod_area: kvod.vod_area,
			vod_lang: kvod.vod_lang,
			vod_director: kvod.vod_director,
			vod_actor: kvod.vod_actor,
			vod_content: kvod.vod_content,
			vod_play_from: kvod.vod_play_from,
			vod_play_url: kvod.vod_play_url
		}
	}),

	play_parse: true,
	lazy: $js.toString(() => {
		let kurl = input.split('*')[0];
		let ktab = input.split('*')[1];
		if (/\.m3u8/.test(kurl)) {
			input = { jx: 0, parse: 0, url: kurl, header: rule.headers }
		} else {
			input = { jx: 1, parse: 1, url: kurl }
		}
	}),

	filter: 'H4sIAAAAAAAAA+2ZW08aQRTH3/kUzT7zMIM39KsYH2jDU60PapsYQ7KKoiLlYivWSr2UKmi9gJqWS9Avw8zCt+jCzDlnSKshqamk2Td+/7Oze/57Of+MLvosbk28mPQtWq/DC9aE9Wo6NDdn+a2Z0Juwi2KjIKOrLr8LTb91hclFa6Yjrxbb0WJHdsGK+LWKBxNATV6cNO8OdU0D1tY/NWsbUFOA5zxeE9U6nFMB1Jz4ldM40zUNuC6dkHYB1inAWrzYbOSgpgBr2ZzbOdQU4PXWy+RPA9YKGepTA/pbPneyGfCnAGtLaWlnoabA6NP5WKc+O4DXq52JxrazsQaXRI5MRfz4OEOz4ZDxNHMlkaj1+zRjq+7xcHUFePW7pNhrwKUVQK19cEo1Deh251jmzsGtAqzdbNM6DVBrbZappoHWlcx1pZ5eTnZl5Qp6UYD+UiVZvQN/Cnru3UI4NGvcu+pts97o894FWGBEa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